from apps.organization.models import Teacher, CourseOrg, City

import xadmin


class CityAdmin(object):
    list_display=['id','name','desc']
    search_fields=['name','desc']
    list_filter=['name','desc','add_time']
    list_editable=['name','desc']
    ordering=["id"]
    model_icon = 'fa fa-university'



class CourseOrgAdmin(object):
    list_display = ['id','name', 'desc', 'click_nums', 'fav_nums']
    search_fields = ['name', 'desc', 'click_nums', 'fav_nums']
    list_filter = ['name', 'desc', 'click_nums', 'fav_nums']
    model_icon = 'fa fa-users'
    style_fields = {
        "desc":"ueditor"
    }


class TeacherAdmin(object):
    list_display = ['id','org', 'name', 'work_years', 'work_company']
    search_fields = ['org', 'name', 'work_years', 'work_company']
    list_filter = ['org', 'name', 'work_years', 'work_company']
    model_icon = 'fa fa-user-md'


xadmin.site.register(City, CityAdmin)
xadmin.site.register(CourseOrg, CourseOrgAdmin)
xadmin.site.register(Teacher, TeacherAdmin)
